using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace GameShow.Forms
{
    public partial class frmPlayer01a : frmBase
    {
        public frmPlayer01a(int parent)
        {
            InitializeComponent();
            AppInstance.CloseForm(parent);            
        }

        protected override void DisplayQuestionForm(int questionId)
        {
            base.DisplayQuestionForm(questionId);
            AppInstance.ShowPlayer02(1);
        }
        
        int x = 100;
        int y = 100;
        int w = 0, h = 0;
        Graphics g = null;
        private void button1_Click(object sender, EventArgs e)
        {
            
            x = 453;
            y = 325;
            w = 100;
            h = 100;

            //Bitmap bm = new Bitmap(AppInstance._Player01b.panel3.Width, AppInstance._Player01b.panel3.Height);
            //AppInstance._Player01b.panel3.DrawToBitmap(bm, AppInstance._Player01b.panel3.ClientRectangle);

            Bitmap bm = new Bitmap(panel1.Width, panel1.Height);
            panel1.DrawToBitmap(bm, panel1.ClientRectangle);

            this.panel2.BackgroundImage = bm;
            this.panel2.BackgroundImageLayout = ImageLayout.Stretch;
            return;

            g = Graphics.FromHwnd(this.Handle);
            //panel1.Visible = false;
            timer1.Start();            
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            x -= 1; 
            y -= 1;
            w += 2;
            h += 2;
            panel1.Width += 2;
            panel1.Height += 2;
            Bitmap bm = new Bitmap(w, h);
            this.panel1.DrawToBitmap(bm, panel1.ClientRectangle);
            g.DrawImage(bm, new Point(x, y));
            if (h >= 350) timer1.Stop();            
        }
    }
}